<?php $this->load->view("admin/$adminCurrentTemplate/commonHead2");?>
<table width="99%" border="0" cellspacing="1" cellpadding="0" class="editFormContainer">
    <form id="editForm" name="editForm" method="post" action="<?=$this->input->server('REQUEST_URI')?>">
	<input type="hidden" name="id" id="id" value="<?=$id?>" />
    <tr>
      <td class="guid">启用状态：</td>
      <td class="formItem">
	  	<input type="radio" name="disabled" id="disabled-0" value="0" checked/><label for="disabled-0"<?php if($disabled==0) echo ' checked'?>>启用</label>
		<input type="radio" name="disabled" id="disabled-1" value="1"<?php if($disabled==1) echo ' checked'?> /><label for="disabled-1">禁用</label>
	  </td>
    </tr>
    <tr>
      <td class="guid">审核状态：</td>
      <td class="formItem">
	  	<input type="radio" name="ismake" id="ismake-0" value="0" checked/><label for="ismake-0"<?php if($ismake==0) echo ' checked'?>>未审核</label>
		<input type="radio" name="ismake" id="ismake-1" value="1"<?php if($ismake==1) echo ' checked'?> /><label for="ismake-1">已审核</label>
      </td>
    </tr>
    <tr>
      <td class="guid">文档标题：</td>
      <td class="formItem"><input type="text" name="title" id="title" class="sing-line input-title" value="<?=$title?>" /></td>
    </tr>
    <tr>
      <td class="guid">关联标识：</td>
      <td class="formItem"><input type="text" name="likeid" id="likeid" class="sing-line input-name" value="<?=$likeid?>" /></td>
    </tr>
    <tr>
      <td class="guid">模板文件：</td>
      <td class="formItem"><input type="text" name="template" id="template" class="sing-line input-name" value="<?=$template?>" /></td>
    </tr>
    <tr>
      <td class="guid">关 键 词：</td>
      <td class="formItem"><input type="text" name="keywords" id="keywords" class="sing-line input-name" value="<?=$keywords?>" /></td>
    </tr>
    <tr>
      <td class="guid">页面摘要：</td>
      <td class="formItem"><textarea name="description" id="description" class="multi-line"><?=$description?></textarea></td>
    </tr>
   <tr>
      <td class="guid">文档内容：</td>
      <td class="formItem"><?php echo $this->CKEditor->editor("content",$content);?></td>
    </tr>
</form>
</table>
<?php $this->load->view("admin/$adminCurrentTemplate/commonFoot2");?>

<script type="text/javascript">
var tvName = '<?php if(isset($tvName)) echo $tvName;?>';
$(function(){
	$('#title').bind('blur',titleBlur);
	var id = $('#id').val();
	dg.addBtn('subBtn','提 交',subForm);
	if(id.length==0) dg.SetTitle('添加文档');
})

var titleBlur = function(){
	var id = $.trim($('#id').val());
	var title = $.trim($('#title').val());
	$.ajax({
		type:'POST',
		url:getInfo + '/check/',
		data:'tvName=' + tvName + '&fieldName=title&fieldValue=' + title + '&id=' + id,
		success:function(returnValue){
			if(parseInt(returnValue)>0){
				subMess(228,108,'文档标题错误','<span class="red">对不起，此标题文档已经存在！</span>',$("#title"));
				return false;
			}
		}
	});
}

var subForm = function(){
	var title = $.trim($('#title').val());
	if(title.length==0){
		subMess(208,108,'文档标题错误','<span class="red">对不起，请输入文档标题！</span>',$("#title"));
		return false;
	}
	
	//return false;
	$('#editForm').submit();
}
</script>